package com.alks.function.mapper.finance.ryfinance;

import com.alks.entity.data.entity.YfApAmt;
import com.alks.entity.data.entity.YfApAmtFk;
import com.alks.function.data.dto.finance.ryfinance.ApAmtHeadDto;
import com.alks.function.data.request.finance.ryfinance.ApAmtHeadRequest;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-05-27
 */
public interface YfApAmtMapper extends BaseMapper<YfApAmt> {

    /**
     * 结算资料查询
     * @param request
     * @param companyId
     * @return
     */
    List<ApAmtHeadDto> apAmtHeadQuery(@Param("request") ApAmtHeadRequest request, @Param("companyId") String companyId);

    /**
     * 结算资料金额求和查询
     * @param request
     * @param companyId
     * @return
     */
    BigDecimal apAmtHeadSum(@Param("request") ApAmtHeadRequest request, @Param("companyId") String companyId);

    /**
     * 应付总金额查询
     *
     * @param slipNos
     * @param companyId
     * @return
     */
    List<Map<String, Object>> amtSumQuery(@Param("slipNos") List<String> slipNos, @Param("companyId") String companyId);

    /**
     * 尾款处理所需数据查询
     * @param slipNos 处理的订单号
     * @param companyId 公司ID
     * @return 尾款处理写入数据
     */
    List<YfApAmtFk> aftPayProcessQuery(@Param("slipNos") List<String> slipNos, @Param("companyId") String companyId);
}
